package com.adz.messagingdemo.eventbus;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.adz.messagingdemo.R;

import org.greenrobot.eventbus.EventBus;

/**
 * Created by Administrator on 2017/3/3.
 * 发送消息
 */

public class SendActivity extends Activity implements View.OnClickListener{
     Button btn;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_send);
        btn= (Button) findViewById(R.id.btn_send);
        btn.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch(view.getId()){
            case R.id.btn_send:
                EventBus.getDefault().post(new MessageBean("2.18我们在一起了！"));
                break;
        }
    }
}
